import request from '@/utils/request'

/**
 * 登录
 * return promise
 */
export const login = data => {
  return request({
    url: '/user/login',
    method: 'POST',
    data
  })
}
/**
 * 用户信息
 * return promise
 */
export const getUserInfo = () => {
  return request({
    url: '/user/info',
    method: 'POST'
  })
}
/**
 * 退出
 * return promise
 */
export function loginout () {
  return request({
    url: '/user/loginout',
    method: 'POST'
  })
}
/**
 * 查询用户账户
 */
export function accountInfo () {
  return request({
    url: '/configuration/account/info',
    method: 'POST'
  })
}
/**
 * 修改添加用户账户
 */
export function accountSaveupdate (data) {
  return request({
    url: '/configuration/account/saveupdate',
    method: 'POST',
    data
  })
}
/**
 * 删除用户账户
 */
export function accountRemove (data) {
  return request({
    url: '/configuration/account/remove',
    method: 'POST',
    data
  })
}
/**
 * 用户角色
 */
export function roleInfo (data) {
  return request({
    url: '/configuration/role/info',
    method: 'POST',
    data
  })
}
